This function simulates the def-instrument-rhythm beat/space string in a note-length format. Many ethnic musics as well as western rock music use the beat/space formulism for rhythm construction.
The quantity and distribution of lengths and rest lengths (beats and spaces) are controlled by ratio-m and ratio-n settings. In the example above the ratio is set to control the random operation to have a distribution of 3 lengths to 1 rest length.